<?php
/*
 * Get list of measurements
 */
$result = DB::sql("SELECT * FROM measurements order by name, abbrev");
$response = array();
foreach ($result as $row):
	//if($row['abbrev']!=NULL):
		//$one['list'] = strtolower($row['abbrev']);
	//else:
		$one['list'] = strtolower($row['name']);
	//endif;
	$one['abbrev'] = strtolower($row['abbrev']);
	$one['name'] = $row['name'];
	$response[] = $one;
endforeach;

header('HTTP/1.1 201');
header("Content-Type: application/json");
echo json_encode($response);

?>
